package com.example.demo.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.demo.bean.NfcBind;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import com.example.demo.vo.NfcVo;

import java.util.List;

@Mapper
public interface NfcBindMapper extends BaseMapper<NfcBind> {


    /**
     * 联表查询：NFC 绑定 + 页面标题
     */
    @Select("SELECT b.id, b.nfc_id, b.page_id, b.bind_time, p.title " +
            "FROM nfc_bind b " +
            "LEFT JOIN page_config p ON b.page_id = p.id " +
            "ORDER BY b.bind_time DESC")
    List<NfcVo> selectListWithTitle();
}
